<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <script src="../vue-2.4.0.js"></script>
  <script src="../node_modules/vue-resource/dist/vue-resource.js"></script>
</head>

<body>

<div id="app">
  <a href="#" class="btn btn-primary" @click="get">get请求</a>
  <a href="#" class="btn btn-primary">post请求</a>
  <a href="#" class="btn btn-primary">jsonp请求</a>
  <p>{{ msg }}</p>
</div>

<script>
  let vm = new Vue({
    el : '#app',
    data : {
      msg : '',
    },
    methods : {
      get(){
        this.$http.get('package.json',{
          params : { userId : '123' },
        }).then(res=>{
          this.msg = res.data;
        })
      },
      post(){

      },
      jsonp(){

      },
    },
  })
</script>
</body>
</html>
